<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>

<body>
  <script>
    function init() {
      return new Promise((resolve, reject) => {
        setTimeout(() => {
          resolve('成功')
        }, 3000)
      })
    }
    async function show() {
      await init().then(result => { console.log(result) })
      setTimeout(() => {
        console.log('show函数执行');
      }, 3000);
    }
    show()
  </script>
</body>

</html>